package com.example.personalfoodadmin.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

import com.example.personalfoodadmin.R;

public class ShoppingManager extends Activity
{

    public static final String USERPROFILE_ID = "com.example.personalfoodadmin.activities.shoppingmanager.USERPROFILE_ID";

    private int id;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.shopping_manager);

        Intent i = this.getIntent();

        this.id = i.getIntExtra(MainMenue.USERPROFILE_ID, 0);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        getMenuInflater().inflate(R.menu.shopping_manager, menu);
        
        return true;
    }

    public void startFoodDatabase(final View view)
    {
        Intent i = new Intent(this, FoodDatabase.class);
        
        i.putExtra(USERPROFILE_ID, this.id);
        
        this.startActivity(i);
    }

    public void createBuyingList(final View view)
    {
        Intent i = new Intent(this, BuyingList.class);
        
        i.putExtra(USERPROFILE_ID, this.id);
        
        this.startActivity(i);
    }
    

    public void showStockList(final View view)
    {
        Intent i = new Intent(this, StockList.class);
        
        i.putExtra(USERPROFILE_ID, this.id);
        
        this.startActivity(i);
    }
    
    public void showPrefferedFoodList(final View view)
    {
        Intent i = new Intent(this, PrefferedFoodList.class);
        i.putExtra(USERPROFILE_ID, this.id);

        this.startActivity(i);
    }
    
    
    public void back(final View view)
    {
        Intent i = new Intent(this, MainMenue.class);
        i.putExtra(USERPROFILE_ID, this.id);

        this.startActivity(i);
    }
    

}
